package com.wsjzzcbq.qianyuan.common.constant;

import java.text.MessageFormat;

/**
 * CacheConsts
 *
 * @author wsjz
 * @date 2022/03/10
 */
public class CacheConsts {

    /**
     * sys系统用户信息缓存
     */
    public static final String QIAN_YUAN_SYS_CACHE = "qianyuan:sys:user:{0}:info";

    /**
     * sys系统用户权限缓存
     */
    public static final String QIAN_YUAN_PERMISSION_CACHE = "qianyuan:sys:user:{0}:permission";

    /**
     * 获取用户信息缓存key
     * @param token
     * @return
     */
    public static String userKey(String token) {
        return MessageFormat.format(QIAN_YUAN_SYS_CACHE, token);
    }

    /**
     * 获取用户权限缓存key
     * @param token
     * @return
     */
    public static String permissionKey(String token) {
        return MessageFormat.format(QIAN_YUAN_PERMISSION_CACHE, token);
    }
}
